<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改电影信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-movieinfo-edit" th:object="${dlMovieInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">电影名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">电影封面图片：</label>
                <div class="col-sm-8">
                    <input name="imagePath" th:field="*{imagePath}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">类型 id：</label>
                <div class="col-sm-8">
                    <select name="kindId" class="form-control m-b" th:with="type=${@dict.getType('dl_kind_id')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{kindId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">制片国家/区域 id：</label>
                <div class="col-sm-8">
                    <select name="regionId" class="form-control m-b" th:with="type=${@dict.getType('dl_region_id')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{regionId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">年代分类id：</label>
                <div class="col-sm-8">
                    <select name="yearsId" class="form-control m-b" th:with="type=${@dict.getType('dl_years_id')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{yearsId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">语言：</label>
                <div class="col-sm-8">
                    <input name="language" th:field="*{language}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">上映日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="screenDate" th:value="${#dates.format(dlMovieInfo.screenDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">片长：</label>
                <div class="col-sm-8">
                    <input name="length" th:field="*{length}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">电影别名：</label>
                <div class="col-sm-8">
                    <input name="alias" th:field="*{alias}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">出品方：</label>
                <div class="col-sm-8">
                    <input name="produce" th:field="*{produce}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">剧情介绍：</label>
                <div class="col-sm-8">
                    <input name="plotIntroduction" th:field="*{plotIntroduction}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电影原声推广曲文件路径：</label>
                <div class="col-sm-8">
                    <input name="movieSong" th:field="*{movieSong}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "mydy/movieinfo";
        $("#form-movieinfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-movieinfo-edit').serialize());
            }
        }

        $("input[name='screenDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>